package com.macro.mall.portal.service.impl;

import cn.hutool.core.collection.CollUtil;
import com.macro.mall.mapper.CmsFeedbackCategoryMapper;
import com.macro.mall.mapper.CmsFeedbackMapper;
import com.macro.mall.mapper.CmsHelpMapper;
import com.macro.mall.model.*;
import com.macro.mall.portal.service.FeedBackService;
import com.macro.mall.portal.service.HelpService;
import com.macro.mall.portal.service.UmsMemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;


@Service
public class HelpImpl implements HelpService {

    @Autowired
    private CmsHelpMapper cmsHelpMapper;

    @Override
    public CmsHelp selPolicyAgreement(Integer type) {
        CmsHelpExample cmsHelpExample = new CmsHelpExample();
        cmsHelpExample.createCriteria().andTypeIdEqualTo(type);
        List<CmsHelp> cmsHelps = cmsHelpMapper.selectByExample(cmsHelpExample);
        if (CollUtil.isNotEmpty(cmsHelps)){
            return CollUtil.getLast(cmsHelps);
        }
        return null;
    }
}
